#!/bin/sh

#
# Allows the user to override environmental variables if wanted. Only
# sets the environmental variable if the environmental variable has
# not already been set.
#
set_ifn()
{
	var=$1
	shift
	val=$1

	cmd="echo \$$var"
	existing=`eval $cmd`

	if [ -z "$existing" ]; then
		export $var=$val
	fi
}

set_ifn TX_ID test1
set_ifn TX_ADDR stdin

# export TX_TRANSPORT_sms=sms,celld.sock,celld-phonebook.txt
export TX_TRANSPORT_1=tcp_in,127.0.0.1,9100
# set_ifn TX_TRANSPORT_2=tcp_in,127.0.0.1,9101
# set_ifn TX_TRANSPORT_2=tcp_out,127.0.0.1,9001,4
# set_ifn TX_TRANSPORT_3=fs,/mount/blah,999

export PYTHONPATH=.

exec python tx/tx.py $*
